<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\MerchantStaff
 *
 * @property int $id
 * @property int $user_id 用户id
 * @property string $phone 用户手机号
 * @property int $merchant_id 商户id
 * @property int $role_id 角色id
 * @property string $remark 备注
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\MerchantStaff onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereMerchantId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereRemark($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereRoleId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MerchantStaff whereUserId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\MerchantStaff withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\MerchantStaff withoutTrashed()
 * @mixin \Eloquent
 */
class MerchantStaff extends Model
{
    protected $table = "merchant_staff";
    use SoftDeletes;

    public static function getUserXMerchant($user_id){
        return self::whereUserId($user_id)->pluck('merchant_id')->toArray();
    }
}
